Gerhard Olsson and Robert Lipe add realtime tracking for XCSV and repair KML tracking.
authorrobertl <robertl>
Fri, 6 Jul 2007 02:03:51 +0000 (02:03 +0000)
committerrobertl <robertl>
Fri, 6 Jul 2007 02:03:51 +0000 (02:03 +0000)
kml.c
xcsv.c
xmldoc/chapters/use.xml

diff --git a/kml.c b/kml.c
index b4f5ba95138a7c82c88deb891147c96a96a0a287..90cc9b671cc1bea81395f7ceabe07ecb74e429ac 100644 (file)
--- a/kml.c
+++ b/kml.c
@@ -302,7 +302,7 @@ kml_wr_deinit(void)
 static void
 kml_wr_position_deinit(void)
 {
-       kml_wr_deinit();
+//     kml_wr_deinit();
        if (posnfilenametmp) {
                xfree(posnfilenametmp);
                posnfilenametmp = NULL;
@@ -971,7 +971,7 @@ kml_wr_position(waypoint *wpt)
                track_del_wpt(posn_trk_head, tonuke);
        }
 
-//     kml_wr_deinit();
+       kml_wr_deinit();
 }
 
 ff_vecs_t kml_vecs = {
diff --git a/xcsv.c b/xcsv.c
index b6ff3163a026b3e861b5ae78473b0212fa23d8a1..a9bfd3d106758b98e0432da9199db47a5e703741 100644 (file)
--- a/xcsv.c
+++ b/xcsv.c
@@ -600,12 +600,47 @@ xcsv_wr_init(const char *fname)
     is_fatal(xcsv_file.gps_datum < 0, MYNAME ": datum \"%s\" is not supported.", opt_datum);
 }
 
+static void
+xcsv_wr_position_init(const char *fname)
+{
+       xcsv_wr_init(fname);
+}
+
 static void
 xcsv_wr_deinit(void)
 {
-    gbfclose(xcsv_file.xcsvfp);
+       gbfclose(xcsv_file.xcsvfp);
 
-    xcsv_destroy_style();
+       xcsv_destroy_style();
+}
+
+static void
+xcsv_wr_position_deinit(void)
+{
+       xcsv_wr_deinit();
+}
+
+
+static void
+xcsv_wr_position(waypoint *wpt)
+{
+       /* Tweak incoming name if we don't have a fix */
+       switch(wpt->fix) {
+               case fix_none: 
+                       if (wpt->shortname) {
+                               xfree(wpt->shortname);
+                       }
+                       wpt->shortname = xstrdup("ESTIMATED Position");
+                       break;
+               default: 
+                       break;
+       }
+
+       waypt_add(wpt);
+       xcsv_data_write();
+       waypt_del(wpt);
+
+       gbfflush(xcsv_file.xcsvfp);
 }
 
 ff_vecs_t xcsv_vecs = {
@@ -619,7 +654,9 @@ ff_vecs_t xcsv_vecs = {
     xcsv_data_write,
     NULL, 
     xcsv_args,
-    CET_CHARSET_ASCII, 0       /* CET-REVIEW */
+    CET_CHARSET_ASCII, 0,      /* CET-REVIEW */
+    { NULL, NULL, NULL, xcsv_wr_position_init, xcsv_wr_position, xcsv_wr_position_deinit }
+
 };
 #else
 void xcsv_read_internal_style(const char *style_buf) {}
index 167f475b386f8943c67c7f54f20adbef9a36fa5b..1a93a0287fa88e625e247bdedefce316c8c8ebba 100644 (file)
@@ -262,8 +262,9 @@ merged data to multiple destinations.
     </para>
     <para>
          As of this writing, Garmin's PVT protocol and NMEA are supported 
-         inputs and KML is supported on output.   Additional formats 
-         may be added by interested parties later.
+         inputs. KML, NMEA, and the variou XCSV formats are supported on 
+         output.   Additional formats may be added by interested parties 
+         later.
     </para>
     <para><userinput>gpsbabel -T -i garmin -f usb: -o kml -F xxx.kml</userinput></para>
     <para>